package com.yang.demo.utils;

import com.yang.demo.entity.Admin;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * 用户goon工具类
 *
 * @author xiaoyang
 * @since  1.0.0
 */
public class AdminUtils {
    /**
     * 获取当前登录的用户对象
     */
    public static Admin getCurrentAdmin(){
        return (Admin) SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
